package com.Servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.contract.sql.insertInfor;
import com.javabean.contract.javaBeanZhuce;

/**
 * Servlet implementation class insertServlet
 */
@WebServlet("/insertServlet")
public class insertServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public insertServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("utf-8");
		javaBeanZhuce us=new javaBeanZhuce();
		insertInfor add=new insertInfor();
		String name=request.getParameter("myname");
		 String school=request.getParameter("school");
		 String youbian=request.getParameter("youbian");
		 String qq=request.getParameter("tencent");
		 String wechat=request.getParameter("wechat");
		 String mobilephone=request.getParameter("mobilephone");
		 String email=request.getParameter("email");
		 String address=request.getParameter("address");
		 String hometel=request.getParameter("hometel");
		 String position=request.getParameter("position");
		 String unit=request.getParameter("unit");
		 String unittel=request.getParameter("unittel");
		us.setName(name);
		us.setEmail(email);
		us.setMobilephone(mobilephone);
		us.setSchool(school);
		us.setUnit(unit);
		us.setYoubian(youbian);
		us.setQq(qq);
		us.setWechat(wechat);
		us.setAddress(address);
		us.setHometel(hometel);
		us.setPosition(position);
		us.setUnittel(unittel);
		add.insert(us);
		request.getRequestDispatcher("/countValueServlet").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
